export const rules = {
  username: [
    {
      required: true,
      message: "用户名必填",
      trigger: "blur",
    },
    {
      pattern: /^[A-Za-z0-9]{5,10}/,
      message: "用户名必须是5~10个字母或数字",
      trigger: "blur",
    },
  ],
  password: [
    {
      required: true,
      message: "密码必填",
      trigger: "blur",
    },
    {
      pattern: /^[A-Za-z0-9]{3,12}$/,
      message: "密码必须是3位以上的字母或数字",
      trigger: "blur",
    },
  ],
  email: [
    {
      required: true,
      message: "邮箱必填",
      trigger: "blur",
    },
    {
      pattern: /^\w+@[A-Za-z]+(\.[A-Za-z0-9]+){1,}$/,
      message: "邮箱必须符合名称@域名规则",
      trigger: "blur",
    },
  ],
  code: [
    {
      required: true,
      message: "验证码必填",
      trigger: "blur",
    },
    {
      pattern: /^[0-9]{6,}$/,
      message: "验证码必须是6位",
      trigger: "blur",
    },
  ]
};
